package com.situ.mall.web.controller;

import com.situ.mall.common.mapper.OnetooneMapper;
import com.situ.mall.common.service.IOnetooneService;
import com.situ.mall.common.vo.ResultVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author yangkx
 * @create 2024-04-19-17:21
 * 服务控制器
 */
@RestController
@RequestMapping("/client")
public class ServiceController {

    @Autowired
    private IOnetooneService onetooneService;

    @Autowired
    private OnetooneMapper onetooneMapper;

    //查询一对一服务列表
    @GetMapping("/service/oneToOne")
    public ResultVO oneToOne() {
        return ResultVO.data(200, "请求成功", onetooneMapper.selectAll());
    }

    //查询一对一服务详情
    @GetMapping("/service/oneDetails")
    public ResultVO oneDetails(Integer id) {
        return ResultVO.data(200, "请求成功", onetooneMapper.selectById(id));
    }

}
